/* 
 * Copyright (c) 2024 Beijing University Of Posts and Telecommunications.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import "console"

rule TestCaseRule_CVE_2022_4450 {
    meta:
        date = "2023-1-15"
        file = "/system/lib/libhukssdk.z.so"
        openharmony_sa = ""
    strings:
        $original_pattern = {08 46 DF 22 7C 44 21 46 82 F0 8A ED 01 98 21 46 DF 22 00 68 82 F0 84 ED}
        $new_pattern = { 08 46 31 46 DF 22 82 F0 92 E8 00 20 31 46 20 60 DF 22 02 9C 20 68 82 F0 8A E8 }

    condition:
        ((not $original_pattern) and $new_pattern) and console.log("CVE_2022_4450 testcase pass")
}